package com.basic.business.goodsIndicators.mapper;

import com.basic.business.declineWarnBoard.vo.DeclineWarnBoardReqVo;
import com.basic.business.declineWarnBoard.vo.DeclineWarnBoardRespVo;
import com.basic.business.goodsIndicators.domain.TGoodsIndicators;
import com.basic.business.goodsIndicators.dto.TGoodsUpNewDateDto;
import com.basic.business.goodsIndicators.vo.CollectData;
import com.basic.business.goodsIndicators.vo.TGoodsIndicatorsVo;
import com.basic.business.goodsLabel.domain.TGoodsLabel;
import com.basic.business.kanban.vo.*;
import com.basic.common.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 商品指标数据Mapper接口
 *
 * @author zhaoxy_jn@163.com
 */
public interface TGoodsIndicatorsMapper extends BaseMapper<TGoodsIndicators> {

    /**
     * 根据文件id删除数据
     * @param fileId
     * @return
     */
    int deleteByFileId(String fileId);

    /**
     * 获取商品指标列表数据
     * @param tGoodsIndicators
     * @return
     */
    List<TGoodsIndicatorsVo> getListVo(TGoodsIndicators tGoodsIndicators);

    /**
     * 获取商品指标统计日期范围汇总列表数据
     * @param tGoodsIndicators
     * @return
     */
    List<TGoodsIndicatorsVo> getSummaryListVo(TGoodsIndicators tGoodsIndicators);

    /**
     * 批量插入
     * @param list
     * @return
     */
    int saveBatch(List<TGoodsIndicators> list);

    /**
     * 批量删除旧数据
     * @param storeId
     * @param statDate
     * @param goodsIdList
     * @return
     */
    int deleteOldData(@Param("storeId")String storeId, @Param("statDate")Date statDate, @Param("goodsIdList")List<String> goodsIdList);

    /**
     * 通过商品id获取数据
     * @param goodsId
     * @return
     */
    List<TGoodsIndicators> getByGoodsId(String goodsId);

    /**
     * 通过商品ids集合获取数据
     * @param goodsIdList
     * @return
     */
    List<TGoodsIndicators> getByGoodsIdList(@Param("goodsIdList")List<String> goodsIdList);

    /**
     * 导出无上新日期商品数据
     * @return
     */
    List<TGoodsUpNewDateDto> exportNoUpNewDate(Long deptId);

    /**
     * 通过id获取商品指标数据
     * @param ids
     * @return
     */
    List<TGoodsIndicators> getListByIds(String[] ids);

    /**
     * 获取产品梯队看板数据
     * @return
     */
    List<Map<String,Object>> getProductEchelon(ProductEchelonVo productEchelonVo);

    /**
     * 获取汇总数据
     * @param tGoodsIndicators
     * @return
     */
    CollectData getCollectData(TGoodsIndicators tGoodsIndicators);

    /**
     * 获取产品梯队月份看板数据
     * @return
     */
    List<Map<String,Object>> getProductMonthEchelon(ProductMonthEchelonVo productMonthEchelonVo);

    /**
     * 获取链接管理看板数据
     * @return
     */
    List<LinkManageRespVo> getLinkData(LinkManagePageReqVo vo);

    /**
     * 批量删除
     * @param ids
     * @return
     */
    int deleteByIdsNew(String[] ids);

    /**
     * 获取滞销管理看板数据
     * @param vo
     * @return
     */
    List<UnsalableRespVo> getUnsalableData(UnsalablePageReqVo vo);

    /**
     * 修改商品标签
     * @param goodsLabel
     * @param goodsId
     * @return
     */
    int updateLabelByGoodsId(@Param("goodsLabel") String goodsLabel, @Param("goodsId") String goodsId);

    /**
     * 批量修改商品标签
     * @param list
     */
    void batchUpdateGoodsLabels(@Param("list") List<TGoodsLabel> list);

    /**
     * 获取刷单商品信息
     * @param goodsId
     * @param statDate
     * @return
     */
    TGoodsIndicators getByGoodsIdAndStatDate(@Param("goodsId")String goodsId, @Param("statDate")Date statDate);

    /**
     * 修改商品指标刷单数据
     * @param tGoodsIndicators
     * @return
     */
    int update(TGoodsIndicators tGoodsIndicators);

    /**
     * 获取下滑预警看板数据
     * @param declineWarnBoardReqVo
     * @return
     */
    List<DeclineWarnBoardRespVo> getDeclineWarnBoardData(DeclineWarnBoardReqVo declineWarnBoardReqVo);
}
